package sn.gandal.mobile.kalpet;

import sn.gandal.mobile.kalpet.adaptators.TextViewAdapter;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.GridView;
import android.widget.TextView;
import android.widget.Toast;

public class CompteCreditActivity extends Activity {
	GridView gridView;
	 
	
	 @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.compte_credit);
	        
	        gridView=(GridView)findViewById(R.id.tabMenu);
	        //ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
				//	android.R.layout.simple_list_item_1, numbers);
	        
			gridView.setAdapter(new TextViewAdapter(getApplicationContext()));
			gridView.setOnItemClickListener(new OnItemClickListener() {
				@Override
				public void onItemClick(AdapterView<?> parent, View v,
					int position, long id) {
				   Toast.makeText(getApplicationContext(),
					((TextView) v).getText(), Toast.LENGTH_SHORT).show();
				}
				
			});
		 }

}
